package com.duan.cart.listener;

import com.alibaba.fastjson.JSONObject;
import com.duan.cart.service.CartService;
import com.duan.order.pojo.Order;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//@Component
//public class listener {
//
//    @Autowired
//    private CartService cartService;
//
//
//    @RabbitListener(queues = RabbitMqConfig.CART_QUEUE)
//    public void cart(String message){
//        //清除购物车
//        Order order = JSONObject.parseObject(message, Order.class);
//        cartService.deleteCart(String.valueOf(order.getProductId()));
//    }
//}
